all: setup	

OBJS = header.o main.o mca.o memory.o pm.o pmjump.o printf.o \
			 regs.o string.o tty.o video.o video-mode.o version.o \
			 apm.o video-vga.o video-vesa.o video-bios.o bioscall.o \
			 cpu.o cpucheck.o edd.o cmdline.o copy.o a20.o

#CFLAGS += -Os -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
					-fno-strict-aliasing -fomit-frame-pointer \
					-ffreestanding  -fno-toplevel-reorder -fno-stack-protector  \
					-mpreferred-stack-boundary=2  -m32 \
					-include code16gcc.h

CFLAGS += -Os -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
					-fno-strict-aliasing -fomit-frame-pointer \
					-ffreestanding \
					-mpreferred-stack-boundary=2  -m32 \
					-include code16gcc.h


%.o: %.S
	@$(CC) $(CFLAGS) -D__ASSEMBLY__ -D__KERNEL__ -c $<

%.o: %.c
	@$(CC) $(CFLAGS) -c $<

setup:	$(OBJS)
	@$(LD) -m elf_i386 -T setup.ld -o $@ $(OBJS) 

clean:
	@rm -f setup *.o  .*.swp *~
